<%--
    Document   : waiter
    Created on : Nov 29, 2011, 2:47:26 PM
    Author     : VIC
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="Beans.*,java.util.Vector,Models.*"%>
<%
    if (session.getAttribute("langid") == null) {
                response.sendRedirect("../index.jsp");
                return;
            }
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>i-Order</title>
        <meta http-equiv="Content-Language" content="vi-vn" />
        <meta name="description" content="i-Order System " />
        <meta name="author" content="Quang Tan Nghia - Nguyen Thi Hoa" />       
    </head>
    <%
                int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
                String dsts = " 'account', 'cancel','signin','signout','updatetable','seltb','joinsplit', 'username', 'password'"; // chuỗi chứa các mã tham số của trang này.
                ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.
                String account = mdsts[0].getTenTS();
                String cancel = mdsts[1].getTenTS();
                String joinsplit = mdsts[2].getTenTS();
                String password = mdsts[3].getTenTS();
                String seltb = mdsts[4].getTenTS();
                String signin = mdsts[5].getTenTS();
                String signout = mdsts[6].getTenTS();
                String updatetable = mdsts[7].getTenTS();
                String username = mdsts[8].getTenTS();
    %>
    <body onload="window.scrollTo(0, 1);">
        
        <%
            if (session.getAttribute("nv") == null) {
        %>
        <form id="formlg" name="clogin" onsubmit="Login();">
            <ul>
                <li><input id="cluser" type="text" placeholder="<%= username %>" name="user"/></li>
                <li><input id="clpass" type="password" placeholder="<%= password %>" name="pass"/></li>
                <li><input onclick="Login();" type="button" value="<%= signin %>"/></li>

            </ul>                
        </form>
        <% } else {
           NhanVien nv = (NhanVien) session.getAttribute("nv");
        %>
        <ul>
            <li><input type="button" onclick="Logout();" value="<%= signout %>"/></li>
            <%                   
                if(NhanVien_Model.CheckQuyen(65, nv.getMaNV()))
                { %>
            <li><input type="button" onclick="SelectTable();" value="<%= seltb %>"/></li>
            <%
            }
            %>
            <%
                    if(NhanVien_Model.CheckQuyen(66, nv.getMaNV()))
                { %>
            <li><input type="button" onclick="GopChuyen();" value="<%= joinsplit %>"/></li>
            <%
            }
            %>
            <%
                    if(NhanVien_Model.CheckQuyen(68, nv.getMaNV()))
                { %>
             <li><input type="button" onclick="CapNhatBan();" value="<%= updatetable %>"/></li>
            <%
            }
            %>
             <li><input onclick="CapNhatTK();" type="button" value="<%= account %>"/></li>
            <li><input onclick="Home();" type="button" value="<%= cancel %>"/></li>
        </ul>
        <% }%>
    </body>
</html>
